/**
 * @file : RHSFactory.h
 * @author: fenghuwuyu
 * @version 1.0
 * @mail: 3148107006@qq.com
 * @date: 2021年04月19日 星期一 16时15分51秒
 * @brief:
 */

#ifndef RHSFACTORY_H
#define RHSFACTORY_H
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include "RHS.h"

class RHSFactory
{
	public:
		typedef ProductRHS* (*RHSCreator)();
		bool RegisterRHS(const std::string &RHSID, RHSCreator createf);
		bool UnregisterRHS(const std::string &RHSID);
		ProductRHS* CreateRHS(const std::string &RHSID) const;
		~RHSFactory(){};
		RHSFactory(const RHSFactory&) = delete;
		RHSFactory &operator=(const RHSFactory&) = delete;
		static RHSFactory& GetInstance();
	private:
		typedef std::map<std::string, RHSCreator> CallbackMap1;
		CallbackMap1 RHSMap;
		RHSFactory();
};

#else
// DO NOTHING
#endif

